Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pylint to 2.16 #1042

Merged
merged 15 commits into from
Mar 22, 2023
Merged

Update pylint to 2.16 #1042

merged 15 commits into from
Mar 22, 2023

Conversation

wshanks
Copy link
Collaborator

@wshanks wshanks commented Feb 12, 2023

Summary

This change set updates pylint from 2.7 to 2.16. The code was modified to satsify new checks added to pylint between those versions. Obsolete settings were removed from the pylintrc file.

Details and comments

The old version of pylint produces false positives that were fixed in a later version than 2.7.

@wshanks wshanks force-pushed the pylint branch 2 times, most recently from c1bc454 to 2d77f3e Compare February 14, 2023 04:06
@wshanks wshanks marked this pull request as ready for review March 16, 2023 22:05
Copy link
Collaborator

@coruscating coruscating left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks good, thanks! I wonder if we should add pre-commit hooks for linting or if people still prefer to be able to commit quickly.

.pylintrc Outdated
# Regular expression matching correct constant names
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Naming hint for constant names
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$

# Regular expression matching correct class names
class-rgx=[A-Z_][a-zA-Z0-9]+$
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since pylint enforces PEP8 name conventions by default, do we need these custom regexes? Are there names we're using now that don't comply with PEP8?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a case of generating the default pylintrc with pylint and then modifying it, so these custom regexes just match the pylint default. We can try removing more stuff from the file. I just removed what I did because pylint was complaining that those options were no longer valid.

pylint has changed some defaults and removed some checkers since version 2.7 to be more in line with things like black.

test/decorators.py Outdated Show resolved Hide resolved
@coruscating coruscating added this pull request to the merge queue Mar 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 21, 2023
@coruscating coruscating added this pull request to the merge queue Mar 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 21, 2023
@coruscating coruscating added this pull request to the merge queue Mar 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 21, 2023
@wshanks wshanks added this pull request to the merge queue Mar 22, 2023
@wshanks wshanks merged commit bccac09 into qiskit-community:main Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants